#ifndef _ADC_H_
#define _ADC_H_

#ifdef __cplusplus
extern "C"
{
#endif

#include "stdio.h"
#include "unistd.h"
#include "sys/types.h"
#include "sys/stat.h"
#include "sys/ioctl.h"
#include "fcntl.h"
#include "stdlib.h"
#include "string.h"
#include <poll.h>
#include <sys/select.h>
#include <sys/time.h>
#include <signal.h>
#include <fcntl.h>
#include <errno.h>

enum path_index {
    IN_VOLTAGE_SCALE = 0,
    IN_VOLTAGE_RAW
};

struct adc_dev {
    int raw;            //采集数据
    float scale;        //采集电压精度
    float act;          //得到的电压
};

extern struct adc_dev myadc;
int file_data_read(char *filename, char *str);
int adc_read(struct adc_dev *dev);

#ifdef __cplusplus
}
#endif
#endif
